package day17;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class RunnablePractice {
    public static void main(String[] args) {
        RunnableTest1 r = new RunnableTest1();
        RunnableTest1 r1 = new RunnableTest1();
//        Thread t1=new Thread(r,"李云龙");
//        Thread t2=new Thread(r,"楚云飞");
//        Thread t3=new Thread(r,"张大彪");
//        Thread t4=new Thread(r,"魏和尚");
//        t1.start();
//        t2.start();
//        t3.start();
//        t4.start();
        ExecutorService pool = Executors.newFixedThreadPool(10);
        for (int i = 0; i < 15; i++) {
            pool.execute(r);
        }
        ExecutorService pool1 = Executors.newFixedThreadPool(10);
        for (int i = 0; i < 10; i++) {
            pool1.execute(r1);
        }

    }
}
class RunnableTest1 implements Runnable{

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+","+Thread.currentThread().getId());
    }
}